public class Book{
String name;     
String writer;     
String press;     
String date;     
public void settername(String name)         
{this.name= name;}    
 public String gettername()    
      {return name;}   
  public void setterwriter(String writer)      
    {this.writer = writer;}    
 public String getterwriter()      
    {return writer;}    
 public void setterpress(String press)       
   {this.press = press;}    
 public String getterpress()        
  {return press;}    
 public void setterdate(String date)        
  {this.date = date;} 
    public String getterdate()          
{return date;}   
  public String toString() {     
    return"书名："+name+"\n"+"作者："+writer+"\n"+"出版社："+press+"\n"+"出版时间："+date+"\n"; }   
  public boolean equals(Object lei) {        
  Book book = (Book) lei;      
    if (!name.equals(book.name))      
       return false;      
    if (!writer.equals(book.writer))     
        return false;      
    if (!press.equals(book.press))         
    return false;      
    if (!date.equals(book.date))        
     return false;      
   return true;  
   }
 } 
